package com.jvmoutofmemory.platform.pushutil.dto;

import com.google.common.collect.Lists;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * @author adam
 * @date 2021-11-17
 */
@Getter
@Setter
@ToString
public class SqlSegment {

    private String sql;

    private List<Object> params;

    public SqlSegment() {
        this.params = Lists.newArrayList();
    }

    public SqlSegment(String sql, List<Object> params) {
        this.sql = sql;
        this.params = params;
    }

    public Object[] getParamArray() {
        return params.toArray(new Object[0]);
    }
}
